<html>
<head>
    <title>gui</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body >
<h1>Hello GUI菜单</h1>
<script>
    var gui = require('nw.gui');
    var menubar = new gui.Menu({ type: 'menubar' });
    var sub1 = new gui.Menu();
    sub1.append(new gui.MenuItem({
        label: '子菜单1',
        click: function() {
            var element = document.createElement('div');
            element.appendChild(document.createTextNode('Test 1'));
            document.body.appendChild(element);
        }
    }));
    menubar.append(new gui.MenuItem({ label: '菜单1', submenu: sub1 }));
    var win = gui.Window.get();
    win.menu = menubar;
</script>
</body>
</html>